package com.shiroha.common.event;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationEventPublisher;

@Slf4j
public class ServiceEventPublisher {

    private final ApplicationEventPublisher eventPublisher;

    public ServiceEventPublisher(ApplicationEventPublisher eventPublisher) {
        this.eventPublisher = eventPublisher;
    }

    public void publishEvent(ServiceEvent event) {
        eventPublisher.publishEvent(event);
        log.info("[ServiceEventPublisher] {}", event.getEventType().getValue());
    }
}
